package good.idea.data.excel;

import good.idea.data.excel.context.ExcelWriteContext;
import good.idea.data.excel.write.ExcelWriteHelper;
import good.idea.data.excel.write.ExcelWriteService;
import good.idea.data.excel.write.impl.ExcelWriteServiceImpl;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

/**
 * @author chm
 */
public class EasyExcelHelper {


    public static ExcelWriteContext exportExcel(String tempPath, Object data) {
        ExcelWriteContext writeContext = ExcelWriteHelper.crateWriteContext();
        writeContext.setTemplateName(tempPath);
        ExcelWriteService writeService = new ExcelWriteServiceImpl();
        writeService.write(writeContext);
        return writeContext;
    }

}
